package com.wcgksoft.entity.admin;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wcgksoft.entity.ConstructionTeam.ConstructionTeam;
import com.wcgksoft.entity.goods.saleRecord;
import com.wcgksoft.entity.system.Enterprise;
import com.wcgksoft.entity.system.EnterpriseProject;
import com.wcgksoft.entity.system.SysRole;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * @author 御风
 * @version V1.0
 * @Package com.wcgksoft.entity.admin
 * @Description TODO 总管理、财务、代理商、销售四种角色账号表
 * @date 2020/5/13 10:01
 * @ClassName account
 */

@Entity
@Table(name="sys_account")
public class Account implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -1636997257344875812L;

    /**
     * id
     */
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Integer id;

    /**
     * 用户随机id
     */
    @Column(name = "userId")
    private String userId;

    /**
     * 账号
     */
    @Column(name = "userName",length=20)
    private String userName;

    /**
     * 密码
     */
    @Column(name = "pass_word",length=100)
    private String passWord;

    /**
     * 性别： 0 男 1 女
     */
    @Column(name = "sex",length=2)
    private Integer sex;


    /**
     * 用户名称
     */

    @Column(name = "name",length=20)
    private String name;

    /**
     * 证件类型 0 个人  1 企业
     */
    @Column(name = "idType")
    private Integer idType;

    /**
     * 开户行名称
     */
    @Column(name = "bankName")
    private String bankName;

    /**
     * 银行卡号
     */
    @Column(name = "bankNum")
    private String bankNum;

    /**
     * 证件号码 个人身份证号码/企业社会信用代码
     */
    @Column(name = "id_card",length=20)
    private String idCard;

    /**
     * 出生日期
     */
    @Column(name = "birth_date")
    private String birthTime;

    /**
     * 邮箱
     */
    @Column(name = "email")
    private String email;
    /**
     * 固定电话
     */
    @Column(name = "tele_phone",length=20)
    private String telePhone;

    /**
     * 手机
     */
    @Column(name = "phone",length=30)
    private String phone;

        /**
     * z状态
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 企业地址
     */
    @Column(name = "address")
    private String address;

    /**
     * 名下用户数
     */
    @Column(name = "userNumber")
    private Integer userNumber;

    /**
     * 销售员数
     */
    @Column(name = "saleMan")
    private Integer saleMan;

    /**
     * 销售额
     */
    @Column(name = "saleMoney")
    private BigDecimal saleMoney;

    /**
     * 奖励金额
     */
    @Column(name = "rewardMoney")
    private BigDecimal rewardMoney;

    /**
     * 待提现金额
     */
    @Column(name="withdrawalMoney")
    private BigDecimal withdrawalMoney;

    /**
     * 销售总套数
     */
    @Column(name = "saleNumber")
    private Integer saleNumber;

    /**
     * 是否有代理权限 0 有  1 无
     */
    @Column(name = "isJurisdiction")
    private Integer isJurisdiction;

    /**
     *  注册日期
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "create_date")
    private Date createDate;

    /**
     *  到期时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "endTime")
    private Date endTime;

    /**
     * 代理商id
     */
    @Column(name="agent_id")
    private Integer agent_id;

    /**
     * 角色
     */
    @OneToOne(fetch = FetchType.EAGER,optional=true)
    @JoinColumn(name = "authority_id",nullable=true)
    @Cascade({org.hibernate.annotations.CascadeType.REFRESH})
    private Authority authority;



    /**
     * 销售记录表
     */
    @Transient
    private List<saleRecord> saleRecords=new ArrayList<>();

    public Integer getSaleNumber() {
        return saleNumber;
    }

    public void setSaleNumber(Integer saleNumber) {
        this.saleNumber = saleNumber;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankNum() {
        return bankNum;
    }

    public void setBankNum(String bankNum) {
        this.bankNum = bankNum;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<saleRecord> getSaleRecords() {
        return saleRecords;
    }

    public void setSaleRecords(List<saleRecord> saleRecords) {
        this.saleRecords = saleRecords;
    }

    public BigDecimal getSaleMoney() {
        return saleMoney;
    }

    public void setSaleMoney(BigDecimal saleMoney) {
        this.saleMoney = saleMoney;
    }

    public Integer getAgent_id() {
        return agent_id;
    }

    public void setAgent_id(Integer agent_id) {
        this.agent_id = agent_id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIdType() {
        return idType;
    }

    public void setIdType(Integer idType) {
        this.idType = idType;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getBirthTime() {
        return birthTime;
    }

    public void setBirthTime(String birthTime) {
        this.birthTime = birthTime;
    }

    public String getTelePhone() {
        return telePhone;
    }

    public void setTelePhone(String telePhone) {
        this.telePhone = telePhone;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getUserNumber() {
        return userNumber;
    }

    public void setUserNumber(Integer userNumber) {
        this.userNumber = userNumber;
    }

    public Integer getSaleMan() {
        return saleMan;
    }

    public void setSaleMan(Integer saleMan) {
        this.saleMan = saleMan;
    }

    public BigDecimal getRewardMoney() {
        return rewardMoney;
    }

    public void setRewardMoney(BigDecimal rewardMoney) {
        this.rewardMoney = rewardMoney;
    }

    public BigDecimal getWithdrawalMoney() {
        return withdrawalMoney;
    }

    public void setWithdrawalMoney(BigDecimal withdrawalMoney) {
        this.withdrawalMoney = withdrawalMoney;
    }

    public Integer getIsJurisdiction() {
        return isJurisdiction;
    }

    public void setIsJurisdiction(Integer isJurisdiction) {
        this.isJurisdiction = isJurisdiction;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Authority getAuthority() {
        return authority;
    }

    public void setAuthority(Authority authority) {
        this.authority = authority;
    }
}
